﻿using Sunxsh.Es.Common;

namespace Sunxsh.Es.Web.Core.Extensions;

public static class ConfigEx
{
    /// <summary>
    /// 系统配置
    /// </summary>
    /// <param name="config"></param>
    public static void AddConfiguration(this IConfigurationManager config)
    {
        config.AddJsonFile("./appsettings.json");
        if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development")
        {
            config.AddJsonFile("./appsettings.Development.json");
        }
        config.Bind(AppConfig.Settings);
    }
}
